﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>自定义URL</title>
    <script type="text/javascript" src="../../Scripts/bootstrap/js/jquery.min.js"></script>
    <script src="../../Scripts/QueryString.js" type="text/javascript"></script>
    <link href="../../../DataUser/Style/ccbpm.css" rel="stylesheet"  type="text/css" />

    <!-- 引用通用的js文件. -->
    <script type="text/javascript" src="../../Scripts/config.js"></script>
    <script type="text/javascript" src="../../Comm/Gener.js"></script>

    <script type="text/javascript" language="javascript" >
        //页面启动函数.
        $(function () {

            var webUser = new WebUser();

            //集团岗位类别
            var staTypesOfGroup = new Entities("BP.GPM.StationTypes");
            staTypesOfGroup.Retrieve("OrgNo", "0");

            //集团岗位.
            var stasOfGroup = new Entities("BP.GPM.Stations");
            stasOfGroup.Retrieve("OrgNo", "0");


            //本组织的岗位类别
            var staTypesOfOrg = new Entities("BP.GPM.StationTypes");
            staTypesOfOrg.Retrieve("OrgNo", webUser.FK_Dept);

            //本组织的岗位.
            var stasOfOrg = new Entities("BP.GPM.Stations");
            stasOfOrg.Retrieve("OrgNo", webUser.FK_Dept);


            //已经选择的岗位.
            var ndStas = new Entities("BP.WF.Template.NodeStations");
            ndStas.Retrieve("FK_Node", GetQueryString("FK_Node"));

            //绑定标签页.

            //绑定选择的信息.
             
        });

        function Save() {

            //删除原来选择的数据..
            var ndStas = new Entities("BP.WF.Template.NodeStations");
            ndStas.Delete("FK_Node", GetQueryString("FK_Node"));

            //获取到当前选择的数据.

            //循环并插入到数据库.
            for (var i = 0; i < length; i++) {
                var ns = new Entity("BP.WF.Template.NodeStation");
                ns.FK_Node = GetQueryString("FK_Node");
                ns.FK_Station = "xxx";
                ns.Insert();
            }

            //重新加载.
            window.location.href = window.location.href;
        }

        //新增岗位类型.
        function NewStationType() {

            var val = window.prompt('请输入岗位类别名称', '');
            if (val == null || val == undefined)
                return;

            var webUser = new WebUser();

            var en = new Entity("BP.WF.Port.StationType");
            en.Name = val;
            en.OrgNo = webUser.FK_Dept;
            en.Insert();

            window.location.href = window.location.href;
        }
    </script>
</head>
<body  >

<form id="cc">

<a href="javascript:NewStationType()" >新建岗位类型</a> | <a href="javascript:NewStation()" >新建岗位</a> 

 集团岗位 | 本组织岗位
 

</form>

</body>
</html>
